//MorrisDraw osztaly
import java.awt.*;
import javax.swing.*;

public class MorrisDraw extends JPanel {

	int x,y;
	MorrisElement me = new MorrisElement();
	
    public MorrisDraw() {
        ImagePanel imgPanel = new ImagePanel(new ImageIcon("morrisBackground.jpg").getImage());
        add(imgPanel);
    }

    public void paintChildren(Graphics g) {
    }

    public void paintComponent(Graphics g) {
        super.paintChildren(g);
        g.setColor(Color.blue);
		for (int i=0; i<7; i++)
			for (int j=0; j<7; j++){
				if (me.element[i][j].isDrawn){
					x = me.element[i][j].getX();
					y = me.element[i][j].getY();
					if (me.element[i][j].getPlayer().equals("red"))
						g.setColor(Color.red);
					else
						if (me.element[i][j].getPlayer().equals("yellow"))
							g.setColor(Color.yellow);
						else g.setColor(Color.blue);
					g.fillOval(x, y, 26, 26);
				}
			}
    }
}